<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1"/>
  <title>Vue直接引入Script资源</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
  <button v-on:click="addCounter">Add 1</button>
  <!-- 以下为缩写 -->
  <button @click="addCounter">Add 1</button>
  <p>The button above has been clicked {{ counter }} times.</p>
</div>
<script>
new Vue({
  el: '#app',
  data () {
    return {
      counter: 0
    };
  },
  methods: {
    addCounter() {
      this.counter += 1;
    }
  }
});
</script>
</body>
</html>